<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>Welcome to Happy Roulette!</title>
		<link rel="stylesheet" type="text/css" href="styles.css" />
	</head>
		
	<body>	
		<script language="javascript" type="text/javascript">
			function check(form){
				form.play.disabled = isNaN(form.chips.value);
			}
			
			function validar(form) {  
			     var1 = form.chips.value;
				 if (var1 < 0 ) {  
			     	alert("El numero de chips debe ser positivo");  
			        return false;  
			     } else {  
			         alert("OK, los valores introducidos son correctos."); 
			         return true ; 
			     }
			}
		</script>
		
		<small><i>Please, enter your name and the amount of chips to have</i></small>
		<br><br>
		
		<form method="post" action="createPlayer" onsubmit="return validar(this);">
			<span>Name:</span> <input name="name" type="text" onkeyup="check(this.form)"/> <br>
			<span>Chips:</span> <input name="chips" type="text" onkeyup="check(this.form)"/> <br>
			<input type="submit" name="play" id="play" value="Play" disabled="disabled"  />
			<input type="reset" value="Borrar" name="boton_borrar">
		</form>	
	</body>
</html>
